package com.fcscs.cservice.domain;

public class Booking extends BookingBase{

	/**
	 * Booking
	 */
	private static final long serialVersionUID = 2775826800067827936L;
	private Restaurant restaurant;
	private GuestProfileDetail guestProfile;
	private boolean restaSet = false;
	private boolean guestpSet = false;
	
	public Restaurant getRestaurant() {
		return restaurant;
	}
	public void setRestaurant(Restaurant restaurant) {
		restaSet = true;
		this.restaurant = restaurant;
	}
	public GuestProfileDetail getGuestProfile() {
		return guestProfile;
	}
	public void setGuestProfile(GuestProfileDetail guestProfile) {
		guestpSet = true;
		this.guestProfile = guestProfile;
	}
	@Override
	public long getRestaurantId() {
		if(restaSet){
			return restaurant == null || restaurant.isNew()? -1 : restaurant.getId();
		}else{
			return super.getRestaurantId();
		}
	}
	@Override
	public long getGuestProfileId() {
		if(guestpSet){
			return guestProfile == null || guestProfile.isNew()? -1 : guestProfile.getId();
		}
		return super.getGuestProfileId();
	}
	
}